<?php

class m131001_070614_add_column_campaign_statics_id extends CDbMigration
{
	public function up()
	{
            $qr = Yii::app()->db->createCommand("SHOW COLUMNS FROM ham_campaign LIKE 'ham_campaign_statistic_id'");
            if(!$qr->queryRow()) {
                $this->addColumn('ham_campaign', 'ham_campaign_statistic_id', 'int');
            }
	}

	public function down()
	{
            return $this->dropColumn('ham_campaign', 'ham_campaign_statistic_id');
	}

	/*
	// Use safeUp/safeDown to do migration with transaction
	public function safeUp()
	{
	}

	public function safeDown()
	{
	}
	*/
}